import java.util.*;
import java.lang.reflect.*;
public class ClassLoader_ {
	public static void main (String [] args) throws Exception{
		Scanner sc = new Scanner(System.in);
		System.out.println("请输入key：");
		String key = sc.next();
		switch (key){
			case "1":
				Dog dog = new Dog();
				dog.cry();
				break;
			case "2":
				//System.out.println("OK");
				Class clazz = Class.forName("com.csust.Person");
				Object o = clazz.newInstance();
				Method method = clazz.getMethod("Hi");
				method.invoke(o);
				break;
			default:
				System.out.println("do nothing...");
		}
	}	
}
class Dog {
	public void cry (){
		System.out.println("小狗汪汪叫！！！");		
	}
}